USE [NANS21V]
GO

/****** オブジェクト: SqlProcedure [dbo].[UseComment] スクリプト日付: 2014/05/09 15:57:34 ******/
USE [NANS21V]
GO

SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[UseComment]') AND type in (N'P', N'PC'))
DROP PROCEDURE [dbo].[UseComment]
GO

CREATE PROCEDURE [dbo].[UseComment]
	@TAIKAINO int,
	@KYOGINO int,
	@ROUNDNO int,
	@SUBNO int
AS
SELECT DISTINCT RC.RCOMMENT,
	TC.COMMENTMEI
FROM dbo.Rcomment(@TAIKAINO, @KYOGINO, @ROUNDNO, @SUBNO) AS RC,
	TBL_COMMENT AS TC
WHERE RC.RCOMMENT = TC.COMMENTRYAKU
GO